using Microsoft.Xna.Framework;

namespace Core
{
    public class Vector2Utilities
    {
        public static void Truncate(Vector2 original, float max)
        {
            if (original.Length() > max)
            {
                original.Normalize();

                original *= max;
            }
        }

        public static Vector2 Perpendicular(Vector2 original)
        {
            //To create a perpendicular vector switch X and Y, then make Y negative
            float x = original.X;
            float y = original.Y;

            y = -y;

            return new Vector2(y, x);
        }
    }
}
